package com.book.service;

import com.book.dao.bookTypeDao;
import com.book.po.BookType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class bookTypeService {
    @Autowired
    private com.book.dao.bookTypeDao bookTypeDao;

    public List<BookType> bookType_select(String bookName){
        return bookTypeDao.bookType_select(bookName);
    };

    public String bookType_insert(BookType bookType){
        if(bookTypeDao.bookType_insert(bookType)!=0){
            return "添加成功";
        }else {
            return "添加失敗";
        }
    }
    public String bookType_update(BookType bookType){
        if(bookTypeDao.bookType_update(bookType)!=0){
            return "修改成功";
        }else {
            return "修改失敗";
        }
    };

    public String bookType_delete(Integer bookId){

        if (bookTypeDao.bookType_delete(bookId)!=0){
            return "刪除成功";
        }else {
            return "刪除失敗";
        }
    };
}
